MICROCHIP DESIGNATED COMMANDS FOR PIC16F8x and PIC16F87x families

Command		Flags Affected	Description             

ADDWF	f,d	C, DC, Z	Add W and f             
ANDWF	f,d	Z		AND W with f
CLRF	f	Z		Clear f
CLRW	-	Z		Clear W
COMF	f,d	Z		Complement f
DECF	f,d	Z		Decrement f
DECFSZ	f,d	-		Decrement f, skip if 0
INCF	f,d	Z		Increment f
INCFSZ	f,d	-		Increment f, skip if 0
IORWF	f,d	Z		Inclusive OR W with f
MOVF	f,d	Z		Move f
MOVWF	f	-		Move W to f
NOP	-	-		No operation
RLF	f,d	C		Rotate left f through Carry
RRF	f,d	C		Rotate right f through Carry
SUBWF	f,d	C, DC, Z	Subtract W from f
SWAPF	f,d	-		Swap nibbles in f
XORWF	f,d	Z		Exclusive OR W with f
BCF	f,b	-		Bit clear f
BSF	f,b	-		Bit set f
BTFSC	f,b	-		Bit test f, skip if 0
BTFSS	f,b	-		Bit test f, skip if 1
ADDLW	k	C, DC, Z	Add literal and W
ANDLW	k	Z		AND literal with W
CALL	k	-		Call subroutine
CLRWDT	TO, PD			Clear Watchdog Timer
GOTO	k	-		Go to address
IORLW	k	Z		Inclusive OR literal with W
MOVLW	k	-		Move literal to W
RETFIE	-	-		Return from interrupt
RETLW	k	-		Return with literal in W
RETURN	-			Return from subroutine
SLEEP	-	TO, PD		Go into standby mode
SUBLW	k	C, DC, Z	Subtract W from literal
XORLW	k	Z		Exclusive OR literal with W

MPASM SHORTHAND COMMANDS
The following shorthand commands are recognised by MPASM
and by Toolkit TK3 in both MPASM and TASM modes. They are not
recognised by EPE TASM PIC Assemblers prior to TK3 (although EPE
Toolkit Mk2 recognises them when translating from MPASM to TASM).
They may not be recognised by other non-MPASM Assemblers.

Command		TK3 coding		Meaning

ADDCF f,d 	BTFSC STATUS,C		Add Carry to File
		INCF f,d

ADDDCF f,d	BTFSC STATUS,DC		Add Digit Carry to File
		INCF f,d

B k		GOTO k			Branch to k

BC k		BTFSC STATUS,C		Branch on Carry to k
		GOTO k

BDC k		BTFSC STATUS,DC		Branch on Digit Carry
		GOTO k

BNC k		BTFSS STATUS,C		Branch on No Carry
		GOTO k

BNZ k		BTFSS STATUS,Z		Branch on Not Zero
		GOTO k

BNDC k		BTFSS STATUS,DC		Branch on No Digit Carry
		GOTO k

BZ k		BTFSC STATUS,Z		Branch on Zero
		GOTO k

CLRC		BCF STATUS,C		Clear Carry

CLRDC		BCF STATUS,DC		Clear Digit Carry

CLRZ		BCF STATUS,Z		Clear Zero

DATA k          RETLW (DATA VAL)	returns with W holding k

MOVFW,f		MOVF f,W		Move File to W

NEGF f,F	COMF f,F		Negate file
		INCF f,F

OPTION 3,5      BSF STATUS,5		Used to set value into
                MOVWF OPTION_REG	OPTION_REG via BANK1
                BCF STATUS,5

SETC		BSF STATUS,C		Set Carry

SETDC		BSF STATUS,DC		Set Digit Carry

SET Z		BSF STATUS,Z		Set Zero

SKPC		BTFSS STATUS,C		Skip on Carry

SKPDC		BTFSS STATUS,DC		Skip on Digit Carry

SKPZ		BTFSS STATUS,Z		Skip on Zero

SKPNC		BTFSC STATUS,C		Skip on No Carry

SKPNDC		BTFSC STATUS,DC		Skip on No Digit Carry

SKPNZ		BTFSC STATUS,Z		Skip on Not Zero

SUBCF f,d	BTFSC STATUS,C		Subtract Carry from File
		DECF f,d

SUBDCF f,d	BTFSC STATUS,DC		Subtract Digit Carry from File
		DECF f,d

TSTF f		MOVF f,F		Test File

TRIS 3,5        BSF STATUS,5		Equivalent of using BANK1/BANK0
                MOVWF (FILENAME)	construction to set TRISA etc
                BCF STATUS,5

Where:
d = destination (0 or 1 - W or F)
f = file
k = literal value

"Include" files are recognised - see Assembly notes

Values in the form of $+1 or $-2 etc are now recognised with V1.4
		click Latest Updates button for info
CBLOCK & ENDC also now recognised with V1.4
		click Latest Updates button for info
HIGH and LOW are also recognised with V1.4
		click Latest Updates button for info

DE	      	when used following ORG H'2100' (or equiv value for
		Data EEPROM address), and followed by data values,
		separated by commas if preferred

__CONFIG k	sets all PIC's configuration bits

_CP_ON
_CP_OFF
_PWRTE_ON
_PWRTE_OFF
_WDT_ON
_WDT_OFF  
_LP_OSC   
_XT_OSC   
_HS_OSC   
_RC_OSC   
(etc)		used to individually set config bits.
		Their equates are held in the 
		selected Microchip .INC file

ADDITIONAL RECOGNITIONS
Macro definitions and routines are recognised
LIST statements for specifying embedded PIC type and Radix
IFDEF, LOCAL (limited use)

NOT RECOGNISED BY TK3
Commands such as IF, END IF, ELSE, WHILE, Y==8 etc.

GRAMMAR DIFFERENCES FOR TASM AND MPASM

The following grammar statements are recognised by Toolkit TK3
in both MPASM and TASM modes (except Octal)

	TASM		MPASM

Decimal	153		D'153'
Hex	$2B		H'2B' or 0x2B
Binary	%10010110	B'10010110'
ASCII	'C'		'C' or A'C'
Octal	-		O'777' (not recognised by TK3)

	.EQU		EQU (with/without decimal point)
	.ORG		ORG (with/without decimal point)
	.END		END (with/without decimal point)
	LABEL:		LABEL (with/without colon)

MPASM COMPATIBILITY
Note that Toolkit TK3 does not not claim to offer full compatibility
with all files created using MPASM grammar. If statements occur in
files which Toolkit does not recognise, it is up to the user to
translate the commands to a more simple form. The author will be
pleased to learn of any which are found, advise him via the EPE
Editorial office.
 
File updated 26JUN04

